class Solution(object):
    def sumFourDivisors(self, nums):
        ans = 0
        for num in nums:
            max_val = num ** 0.5
            if int(max_val) != max_val:
                c = 0
                i = 2
                for i in range(2, int(max_val) + 1):
                    if num % i == 0:
                        yinzi1 = i
                        yinzi2 = num // i
                        c += 1
                        if c >= 2:
                            break
                if c == 1:
                    ans += num + 1 + yinzi1 + yinzi2
        return ans



data = Solution()
nums = [1,2,3,4,5,6,7,8,9,10]
print(data.sumFourDivisors(nums))
